Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

outlayer

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

outlayer

the brains and guts of a layout library

  • 2.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
193K
decreased by-1.65%
Maintainers
1
Weekly downloads
 
Created

What is outlayer?

Outlayer is a JavaScript library for creating and managing layouts. It provides a foundation for layout libraries like Masonry, Isotope, and Packery. Outlayer handles the positioning of items within a container, allowing for dynamic and responsive layouts.

What are outlayer's main functionalities?

Basic Layout Initialization

This code initializes a basic layout using Outlayer. It selects a container element and applies the layout to items within that container.

const Outlayer = require('outlayer');
const elem = document.querySelector('.container');
const layout = new Outlayer(elem, {
  itemSelector: '.item'
});

Adding Items to Layout

This code demonstrates how to add new items to an existing layout. After creating a new item, it is added to the layout and the layout is updated.

const newItem = document.createElement('div');
newItem.className = 'item';
layout.addItems([newItem]);
layout.layout();

Removing Items from Layout

This code shows how to remove items from the layout. The specified item is removed and the layout is updated accordingly.

const itemToRemove = document.querySelector('.item-to-remove');
layout.remove([itemToRemove]);
layout.layout();

Filtering Items

This code filters the items in the layout to only show those that match the specified selector. In this case, only items with the class 'active' will be displayed.

layout.filter('.active');

Other packages similar to outlayer

Keywords

FAQs

Package last updated on 19 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc